<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
if($_RQ['basicname']){
	$_SESSION['plugin_name']=$_RQ['basicname'];
}
$return=array();
if(!$_RQ['plugin']){
	exi('请先选择模块！','error');
}
$return['m']=$_RQ['plugin'];
if($_RQ['op']=='get'){
	$module=pdo_get('core_plugins',array('name'=>$_RQ['plugin']));
	if(!$module){
		exi('找不到指定模块！'.$_RQ['plugin'],'error');
	}
	$return['title']=$module['title'];
	$htmls=array();
	$menu_list=array();
	$menu_file=ROOT_PLUGIN.$module['name'].'/model/merch_menu.php';
	if(is_file($menu_file)){
			$menu_list=plugin($module['name'])->merch_menu();
			$htmls=array();
			if($_SESSION['os']!='windows'){
				$htmls[]=array('type'=>'module_top');
				if($module['is_legao']){
					$_SESSION['manage_plugin']=$module['name'];
					$htmls[]=array('type'=>'list_menu3','menus'=>$menu_list);
				}else{
					$htmls[]=array('type'=>'list_menu2','menus'=>$menu_list);
				}
			}else{
				foreach($menu_list as $menu){
					$htmls[]=array('type'=>'list_menu','title'=>$menu['title'],'menus'=>$menu['child']);
				}
			}
	}
	if($menu_list){
		set_html('top_plugin_menu',$menu_list,true);
	}
	if(is_file(ROOT_PLUGIN.$module['name'].'/custom/actions/merch/index.php')){
		exi('','',$module['name'].'/merch.index/');
	}
	if(is_file(ROOT_PLUGIN.$module['name'].'/custom/actions/manage/index.php')){
		exi('','',$module['name'].'/manage.index/');
	}
	$pluginset=plugin($module['name'])->plugin_setting('basic');
	$return['htmls']=$htmls;
	exi($return);
}